#pragma once
#include "../gm_api/gm_global.h"
#include <string.h>
#include "gm_handle_mgr.h"

#include "gm_handle.h"
#include "gm_sc_key.h"
#include "gm_sc_mac.h"

class gm_sc_cont : public gm_handle
{
public:
	gm_sc_cont(void);
	gm_sc_cont(int id, char* szName, ULONG appId);
	~gm_sc_cont(void);

public:
	char * Name();

	void Name(char * val);

	ULONG get_app_id();

	ULONG id();

	gm_handle_mgr* get_key_mgr();

	gm_handle_mgr *get_mac_mgr();

	gm_sc_key * find_key(HANDLE hkey);

	gm_sc_mac * find_mac(HANDLE hMac);

	gm_sc_key * create_session_key(int session_id, ULONG alg_id);

	ULONG		remove_session_key(HANDLE hKey);

	gm_sc_mac * create_mac_key(int session_id, ULONG alg_id);

	ULONG		remove_mac_key(HANDLE hKey);

	gm_sc_key * get_first_key();

	void		clear_keys();
private:
	void		clear();


private:
	char		_szName[128];
	ULONG		_ulid;

	gm_handle_mgr	sc_key_mgr;
	gm_handle_mgr	sc_mac_mgr;
	ULONG		_ulAppId;

};
